/**
 * Copyright (C) 2016 Hyphenate Inc. All rights reserved.
 * <p/>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.srwl.mytx.dao;

import android.content.Context;

import com.srwl.mytx.domain.Contact;
import com.srwl.mytx.domain.RobotUser;
import com.srwl.mytx.domain.Topic;

import java.util.List;
import java.util.Map;

@Deprecated
public class UserDao {
    public static final String CONTACT_TABLE_NAME = "contact";
    public static final String COLUMN_NAME_CONTACT_ID= "c_id";
    public static final String COLUMN_NAME_TARGET_CONTACT_ID= "t_cid";
    public static final String COLUMN_NAME_TARGET_USER_ID= "u_id";
    public static final String COLUMN_NAME_USER_NAME = "username";
    public static final String COLUMN_NAME_NICK = "nick";
    public static final String COLUMN_NAME_AVATAR = "avatar";
    static final  String COLUMN_NAME_GENDER="gender";
    static final  String COLUMN_NAME_AREA="area";
    static final  String COLUMN_NAME_RELATION="relation";
    static final  String COLUMN_NAME_STATUS="status";
    static final  String COLUMN_NAME_AUTHORITY="authority";
    static final  String COLUMN_NAME_TARGET_AUTHORITY="t_authority";
    static final  String COLUMN_NAME_GROUP_NAME ="group_name";//不能用group 不然报错，在mysql 里面字段名字取 group 却没有报错
    static final  String COLUMN_NAME_PHONE="phone";
    static final  String COLUMN_NAME_INVITE_MESSAGE="invite_essage";

    public static final String PREF_TABLE_NAME = "pref";
    public static final String COLUMN_NAME_DISABLED_GROUPS = "disabled_groups";
    public static final String COLUMN_NAME_DISABLED_IDS = "disabled_ids";

    public static final String ROBOT_TABLE_NAME = "robots";
    public static final String ROBOT_COLUMN_NAME_ID = "username";
    public static final String ROBOT_COLUMN_NAME_NICK = "nick";
    public static final String ROBOT_COLUMN_NAME_AVATAR = "avatar";

    static final String INFINITE_TABLE_NAME="infinite_connect";
    static final String INFINITE_COLUMN_NAME_ID="i_id";
    static final String INFINITE_COLUMN_CONTACT_ID="c_id";
    static final String INFINITE_COLUMN_CONNECT_KEY="connect_key";
    static final String INFINITE_COLUMN_LAYER="layer";
    static final String INFINITE_COLUMN_AUTHORITY="authority";



    public UserDao(Context context) {
    }




    public void saveContactList(List<Contact> contactList) {
        DemoDBManager.getInstance().saveContactList(contactList);
    }


    public void saveGoodsList(List<Topic> goodsList){
        DemoDBManager.getInstance().saveGoodsList(goodsList);
    }
    public List<Topic> getGoodsList(){
        return DemoDBManager.getInstance().getGoodsList();
    }
    public void saveContact(Contact contact) {
        DemoDBManager.getInstance().saveContact(contact);
    }

    /**
     *
     * @param id  联系人Id
     */
    public void deleteContact(String id) {
        DemoDBManager.getInstance().deleteContact(id);
    }

    public List<Contact> getContactList() {
        return DemoDBManager.getInstance().getContactList();
    }





    public void setDisabledGroups(List<String> groups) {
        DemoDBManager.getInstance().setDisabledGroups(groups);
    }

    public List<String> getDisabledGroups() {
        return DemoDBManager.getInstance().getDisabledGroups();
    }

    public void setDisabledIds(List<String> ids) {
        DemoDBManager.getInstance().setDisabledIds(ids);
    }

    public List<String> getDisabledIds() {
        return DemoDBManager.getInstance().getDisabledIds();
    }

    public Map<String, RobotUser> getRobotUser() {
        return DemoDBManager.getInstance().getRobotList();
    }

    public void saveRobotUser(List<RobotUser> robotList) {
        DemoDBManager.getInstance().saveRobotList(robotList);
    }
}
